﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace UI.ProductManagement
{
    public partial class FrmPot0a06Edit : UI.ParentForm.BaseEdit
    {
        public FrmPot0a06Edit(string action, string text, string key)
            : base(action)
        {
            InitializeComponent();

            this.Text = text;
            this.key = key;
            //回写的方法
            this.SaveCallFuntion = "Pot0a06Manager$SaveData"; //保存的方法
            if ("A" == this.Action)
            {
                IsAfterSaveCloseWin = false;
            }

            this.Size = base.MinWindow;
        }

        protected override bool Check()
        {
            if ("A" == this.Action)
            {
                System.Collections.Hashtable hs = new System.Collections.Hashtable();
                hs["calcode"] = this.tbSummary.GetValue("calcode");
                bool reflt = UI.Lib.Factory.CommonHelper.Entity.DataInData("Pot0a06", hs);
                if (reflt)
                {
                    MessageBox.Show("当前设置的代码已经存在！", "提示");
                    this.tbSummary.Focus("calcode");
                    return false;
                }

                return true;
            }

            return true;
        }
    }
}